package com.senior.sendmessage.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author Baijl
 * @version 0.0.1
 * @date 2021-12-10 20:00
 * @description TODO
 */
@Data
@NoArgsConstructor
public class WeatherResultDTO {
    @JsonProperty("reason")
    private String reason;
    @JsonProperty("result")
    private ResultDTO result;
    @JsonProperty("error_code")
    private Integer errorCode;

    @NoArgsConstructor
    @Data
    public static class ResultDTO {
        @JsonProperty("city")
        private String city;
        @JsonProperty("realtime")
        private RealtimeDTO realtime;
        @JsonProperty("future")
        private List<FutureDTO> future;

        @NoArgsConstructor
        @Data
        public static class RealtimeDTO {
            @JsonProperty("temperature")
            private String temperature;
            @JsonProperty("humidity")
            private String humidity;
            @JsonProperty("info")
            private String info;
            @JsonProperty("wid")
            private String wid;
            @JsonProperty("direct")
            private String direct;
            @JsonProperty("power")
            private String power;
            @JsonProperty("aqi")
            private String aqi;
        }

        @NoArgsConstructor
        @Data
        public static class FutureDTO {
            @JsonProperty("date")
            private String date;
            @JsonProperty("temperature")
            private String temperature;
            @JsonProperty("weather")
            private String weather;
            @JsonProperty("wid")
            private WidDTO wid;
            @JsonProperty("direct")
            private String direct;

            @NoArgsConstructor
            @Data
            public static class WidDTO {
                @JsonProperty("day")
                private String day;
                @JsonProperty("night")
                private String night;
            }
        }
    }
}
